package com.teamide.bean;

import java.io.Serializable;

/**
 * 结果集对象
 * 
 * @author ZhuLiang
 *
 * @param <T>
 *            结果类型
 */
public class ResultBean<T> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private T value;

	protected String errcode = "0";

	protected String errmsg;

	public T getValue() {

		return value;
	}

	public void setValue(T value) {

		this.value = value;

	}

	@SuppressWarnings("unchecked")
	public final void setObjectValue(Object value) {

		T v = null;
		if (value != null) {
			v = (T) value;
		}
		this.setValue(v);

	}

	public String getErrcode() {

		return errcode;
	}

	public void setErrcode(int errcode) {

		this.setErrcode(Integer.toString(errcode));
	}

	public void setErrcode(String errcode) {

		this.errcode = errcode;
	}

	public String getErrmsg() {

		return errmsg;
	}

	public void setErrmsg(String errmsg) {

		this.errmsg = errmsg;
	}

	public static long getSerialversionuid() {

		return serialVersionUID;
	}

}
